[routers:vars]
ansible_user=ec2-user

[routers:children]
{% if network_type == "multivendor" or network_type == "cisco" %}
cisco
{% endif %}
{% if network_type == "multivendor" or network_type == "juniper" %}
juniper
{% endif %}
{% if network_type == "multivendor" or network_type == "arista" %}
arista
{% endif %}

{% if network_type == "multivendor" or network_type == "cisco" %}
[cisco]
{% endif %}
{% if network_type == "arista" %}
[arista]
{% endif %}
{% if network_type == "juniper" %}
[juniper]
{% endif %}
{% for vm in rtr1_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
{{ vm.tags.short_name }} ansible_host={{ vm.public_ip_address }} private_ip={{ vm.private_ip_address }}
{% endif %}
{% endfor %}
{% if network_type == "multivendor" %}
[arista]
{% endif %}
{% for vm in rtr2_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
{{ vm.tags.short_name }} ansible_host={{ vm.public_ip_address }} private_ip={{ vm.private_ip_address }}
{% endif %}
{% endfor %}
{% for vm in rtr4_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
{{ vm.tags.short_name }} ansible_host={{ vm.public_ip_address }} private_ip={{ vm.private_ip_address }}
{% endif %}
{% endfor %}
{% if network_type == "multivendor" %}
[juniper]
{% endif %}
{% for vm in rtr3_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
{{ vm.tags.short_name }} ansible_host={{ vm.public_ip_address }} private_ip={{ vm.private_ip_address }}
{% endif %}
{% endfor %}

{% if network_type == "multivendor" or network_type == "cisco" %}
[cisco:vars]
ansible_network_os=ios
ansible_connection=network_cli
{% endif %}

{% if network_type == "multivendor" or network_type == "juniper" %}
[juniper:vars]
ansible_network_os=junos
ansible_connection=netconf
{% endif %}

{% if network_type == "multivendor" or network_type == "arista" %}
[arista:vars]
ansible_network_os=eos
ansible_connection=network_cli
ansible_become=true
ansible_become_method=enable
{% endif %}

[dc1]
rtr1
rtr3

[dc2]
rtr2
rtr4

[control]
{% for vm in ansible_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
{{ vm.tags.short_name }} ansible_host={{ vm.public_ip_address }} ansible_user={{ vm.tags.username }} private_ip={{ vm.private_ip_address }}
{% endif %}
{% endfor %}

[network:children]
routers
[network:vars]
restore_inventory="Workshop Inventory"
restore_credential="Workshop Credential"
restore_project="Workshop Project"
